package com.han.walkman.service.impl;

import com.han.walkman.dao.RecommendSwiperDao;
import com.han.walkman.entity.RecommendSwiperEntity;
import com.han.walkman.service.RecommendSwiperService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: Hanjiafeng
 * @Date: 2020/5/7
 * @Desc: 轮播图操作实现类
 */
@Service
public class RecommendSwiperServiceImpl implements RecommendSwiperService {
    private final RecommendSwiperDao recommendSwiperDao;

    public RecommendSwiperServiceImpl(RecommendSwiperDao recommendSwiperDao) {
        this.recommendSwiperDao = recommendSwiperDao;
    }

    @Override
    public void add(RecommendSwiperEntity recommendSwiperEntity) {
        recommendSwiperDao.save(recommendSwiperEntity);
    }

    @Override
    public void delete(RecommendSwiperEntity recommendSwiperEntity) {
        recommendSwiperDao.delete(recommendSwiperEntity);
    }

    @Override
    public void update(RecommendSwiperEntity recommendSwiperEntity) {
        recommendSwiperDao.save(recommendSwiperEntity);
    }

    @Override
    public List<RecommendSwiperEntity> findAll() {
        return recommendSwiperDao.findAll();
    }
}
